<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
	<!--========= RESOURCE DEFINITIONS ===================-->
	<bean id="baseDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName">
	    	<value>java:/comp/env/jdbc/hre-app</value>
        </property>
    </bean>	
    
	<!-- JNDI DataSource for J2EE environments -->
 
	<bean id="baseSessionFactory"
		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<!-- 			<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect </prop> -->
				<prop key="hibernate.show_sql">true</prop>
				<prop key="hibernate.use_outer_join">true</prop>
				<prop key="hibernate.jdbc.batch_size">50</prop>
				<prop key="hibernate.jdbc.fetch_size">5</prop>
				<prop key="hibernate.connection.pool_size">2</prop>
				<prop key="hibernate.connection.autocommit">false</prop>
				<prop key="hibernate.cache.use_query_cache">false</prop>
				<prop key="hibernate.max_fetch_depth">1</prop>
				<prop key="hibernate.cglib.use_reflection_optimizer">false</prop>
				<prop key="hibernate.bytecode.use_reflection_optimizer">true</prop>
			</props>
		</property>
		<property name="mappingLocations">
			<list>
				<value>classpath*:com/edu/hre/db/pojo/*.hbm.xml</value>
			</list>
		</property>
		<property name="dataSource">
			<ref local="baseDataSource" />
		</property>
	</bean>
	<bean id="baseHibernateTempate" class="org.springframework.orm.hibernate3.HibernateTemplate">
		<property name="sessionFactory">
			<ref bean="baseSessionFactory" />
		</property>
	</bean>
	<!--
		Transaction manager for a single Hibernate SessionFactory (alternative to JTA)
	-->
	<bean id="baseTransactionManager"
		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
		<property name="sessionFactory">
			<ref local="baseSessionFactory" />
		</property>
	</bean>
	<!--======== BUSINESS OBJECT DEFINITIONS=============--> 
	<!-- Data access object: Hibernate implementation. -->
	
	<bean id="baseDAO" class="com.edu.hre.db.dao.impl.BaseDaoHibernate">
		<property name="hibernateTemplate">
			<ref local="baseHibernateTempate" />
		</property>
	</bean>
	<!--=====SERVICE OBJECTS=====-->
	<bean id="baseServiceTarget" class="com.edu.hre.db.service.impl.BaseServiceImpl">
		<property name="baseDao">
			<ref local="baseDAO" />
		</property>
	</bean>
	<bean id="baseService"
		class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
		<property name="transactionManager">
			<ref local="baseTransactionManager" />
		</property>
		<property name="target">
			<ref local="baseServiceTarget" />
		</property>
		<property name="transactionAttributes">
			<props>
				<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="search*">PROPAGATION_REQUIRED</prop>
				<prop key="insert*">PROPAGATION_REQUIRED</prop>
				<prop key="update*">PROPAGATION_REQUIRED</prop>
				<prop key="delete*">PROPAGATION_REQUIRED</prop>
			</props>
		</property>
		<property name="proxyInterfaces">
			<value>com.edu.hre.db.service.BaseService</value>
		</property> 
	</bean> 
	
	<bean id="employeeDAOService" class="com.edu.hre.db.sql.pim.EmployeeDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="locationDAOService" class="com.edu.hre.db.sql.admin.LocationDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="payGradeDAOService" class="com.edu.hre.db.sql.admin.PayGradeDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="employmentStatusDAOService" class="com.edu.hre.db.sql.admin.EmploymentStatusDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="jobCategoryDAOService" class="com.edu.hre.db.sql.admin.JobCategoryDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="skillDAOService" class="com.edu.hre.db.sql.admin.SkillDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="educationDAOService" class="com.edu.hre.db.sql.admin.EducationDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="majorDAOService" class="com.edu.hre.db.sql.admin.MajorDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="licenseDAOService" class="com.edu.hre.db.sql.admin.LicenseDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="languageDAOService" class="com.edu.hre.db.sql.admin.LanguageDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="nationalityDAOService" class="com.edu.hre.db.sql.admin.NationalityDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="compensationDAOService" class="com.edu.hre.db.sql.admin.CompensationDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="customerDAOService" class="com.edu.hre.db.sql.admin.CustomerDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="projectDAOService" class="com.edu.hre.db.sql.admin.ProjectDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="userDAOService" class="com.edu.hre.db.sql.admin.UserDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="empDependentDAOService" class="com.edu.hre.db.sql.pim.EmpDependentDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="empEmergencyContactDAOService" class="com.edu.hre.db.sql.pim.EmpEmergencyContactDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="empSupervisorDAOService" class="com.edu.hre.db.sql.pim.EmpSupervisorDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="empSubordinateDAOService" class="com.edu.hre.db.sql.pim.EmpSubordinateDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="empExperienceDAOService" class="com.edu.hre.db.sql.pim.EmpExperienceDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="empEducationDAOService" class="com.edu.hre.db.sql.pim.EmpEducationDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="empSkillDAOService" class="com.edu.hre.db.sql.pim.EmpSkillDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="empLanguageDAOService" class="com.edu.hre.db.sql.pim.EmpLanguageDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="empLicenseDAOService" class="com.edu.hre.db.sql.pim.EmpLicenseDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="empSalaryDAOService" class="com.edu.hre.db.sql.pim.EmpSalaryDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="empCompensationDAOService" class="com.edu.hre.db.sql.pim.EmpCompensationDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="empJobDAOService" class="com.edu.hre.db.sql.pim.EmpJobDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="empTerminationReasonDAOService" class="com.edu.hre.db.sql.pim.EmpTerminationReasonDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="empReportingMethodDAOService" class="com.edu.hre.db.sql.pim.EmpReportingMethodDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	
	
	
	<bean id="candidateDAOService" class="com.edu.hre.db.sql.recruit.CandidateDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="canEducationDAOService" class="com.edu.hre.db.sql.recruit.CanEducationDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="canLanguageDAOService" class="com.edu.hre.db.sql.recruit.CanLanguageDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="canLicenseDAOService" class="com.edu.hre.db.sql.recruit.CanLicenseDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="canSkillDAOService" class="com.edu.hre.db.sql.recruit.CanSkillDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="canExperienceDAOService" class="com.edu.hre.db.sql.recruit.CanExperienceDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="vacancyDAOService" class="com.edu.hre.db.sql.recruit.VacancyDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	<bean id="interviewDAOService" class="com.edu.hre.db.sql.recruit.InterviewDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
	
	<bean id="leaveRequestDAOService" class="com.edu.hre.db.sql.leave.LeaveRequestDAOService">
		<property name="baseService">
			<ref local="baseService"/>
		</property>
	</bean>
</beans>